import { IsNotEmpty, IsUUID, IsString, MaxLength, IsOptional, ValidateIf, MinLength, IsArray } from 'class-validator';
export class CreateArticleDto {
    @IsNotEmpty()
    @MaxLength(22)
    @MinLength(2)
    title: string

    @IsNotEmpty()
    content: string

    @IsArray()
    @IsString({ each: true })
    covers: string[]

    @IsUUID()
    @IsOptional()
    @ValidateIf(o => o.name != '')
    topic_id?: string

    @IsOptional()
    @ValidateIf(o => o.name != '')
    address?: string

}
